import {VueComponent, Router, RouterManage} from "modules";
import {default as routes} from "router";
import Vuex from "vuex";
// import VueAntd from "vue-antd";
import App from "./App.vue";
import vuexOption from "store";
import {sync} from "vuex-router-sync";
import "styles/index.less";
import Main from "./main";
// import "./sw-register";
import {RouterOptions} from "vue-router";

if (process.env.NODE_ENV === "production") {
  System.import("./sw-register"); // 加载缓存
}
const store  = new Vuex.Store(vuexOption);
const router = new Router(RouterManage.filterOption({routes})  as RouterOptions);

sync(store, router, {moduleName: "route"});

const app = new VueComponent({
  render: (h: any) => h(App),
  store,
  router,
  mounted() { new Main(this); },
});

app.$mount("#app");
(window as any).app = app;
